/*单选框 */
/**
 * 隐藏默认的checkbox
 */
input[type=checkbox] {
    visibility: hidden;
}

.wmy-checkbox {
    width: 25px;
    margin: 20px 100px;
    position: relative;

    label {
        cursor: pointer;
        position: absolute;
        width: 27px;
        height: 26px;
        top: 0;
        left: 0;
        background: #eee;
        border: 1px solid #ddd;

        &:after {
            opacity: 0.2;
            content: '';
            position: absolute;
            width: 9px;
            height: 5px;
            background: transparent;
            top: 6px;
            left: 7px;
            border: 3px solid #333;
            border-top: none;
            border-right: none;
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            -o-transform: rotate(-45deg);
            -ms-transform: rotate(-45deg);
            transform: rotate(-45deg);
        }

        &:hover {
            &::after {
                opacity: 0.5;
            }
        }
    }

    input[type=checkbox]:checked {
        &+label {
            &:after {
                opacity: 1;
            }
        }
    }
}

.wmy-checkboxOne {
    width: 40px;
    height: 10px;
    background: #555;
    margin: 20px 80px;
    position: relative;
    border-radius: 3px;

    label {
        display: block;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        transition: all .5s ease;
        cursor: pointer;
        position: absolute;
        top: -3px;
        left: -3px;
        background: #ccc;
    }

    input[type=checkbox]:checked {
        &+label {
            left: 27px;
        }
    }
}

.wmy-checkboxTwo {
    width: 120px;
    height: 40px;
    background: #333;
    margin: 20px 60px;
    border-radius: 50px;
    position: relative;

    input[type=checkbox]:checked {
        &+label {
            left: 84px;
            background: #26ca28;
        }
    }

    label {
        display: block;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        -webkit-transition: all .5s ease;
        -moz-transition: all .5s ease;
        -o-transition: all .5s ease;
        -ms-transition: all .5s ease;
        transition: all .5s ease;
        cursor: pointer;
        position: absolute;
        top: 9px;
        z-index: 1;
        left: 12px;
        background: #ddd;
    }

    &:before {
        content: '';
        position: absolute;
        top: 19px;
        left: 14px;
        height: 2px;
        width: 90px;
        background: #111;
    }
}


.wmy-checkboxThree {
    width: 120px;
    height: 40px;
    background: #333;
    margin: 20px 60px;
    border-radius: 50px;
    position: relative;

    &:before {
        content: 'On';
        position: absolute;
        top: 12px;
        left: 13px;
        height: 2px;
        color: #26ca28;
        font-size: 16px;
    }

    &:after {
        content: 'Off';
        position: absolute;
        top: 12px;
        left: 84px;
        height: 2px;
        color: #ddd;
        font-size: 16px;
    }

    label {
        display: block;
        width: 52px;
        height: 22px;
        border-radius: 50px;
        -webkit-transition: all .5s ease;
        -moz-transition: all .5s ease;
        -o-transition: all .5s ease;
        -ms-transition: all .5s ease;
        transition: all .5s ease;
        cursor: pointer;
        position: absolute;
        top: 9px;
        z-index: 1;
        left: 12px;
        background: #ddd;
    }

    input[type=checkbox]:checked {
        &+label {
            left: 60px;
            background: #26ca28;
        }
    }
}

.wmy-checkboxFour {
    width: 40px;
    height: 40px;
    background: #ddd;
    margin: 20px 90px;
    border-radius: 100%;
    position: relative;
    -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);

    label {
        display: block;
        width: 30px;
        height: 30px;
        border-radius: 100px;
        -webkit-transition: all .5s ease;
        -moz-transition: all .5s ease;
        -o-transition: all .5s ease;
        -ms-transition: all .5s ease;
        transition: all .5s ease;
        cursor: pointer;
        position: absolute;
        top: 5px;
        left: 5px;
        z-index: 1;
        background: #333;
        -webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.5);
        -moz-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.5);
        box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.5);
    }

    input[type=checkbox]:checked {
        &+label {
            background: #26ca28;
        }
    }
}



/* html使用,采用one,two类推选择 */
/* <div class="checkboxOne"><input type="checkbox"value="1"id="1"name=""/><label for="1"></label></div> */